<?php

/**
 * This is the model class for table "pelakuinvestasipariwisata".
 *
 * The followings are the available columns in table 'pelakuinvestasipariwisata':
 * @property integer $pip_id
 * @property integer $pip_target_pelaku
 * @property integer $pip_real_pelaku
 * @property integer $pip_target_tngkerja
 * @property integer $pip_real_tngkerja
 * @property integer $pip_target_invest
 * @property integer $pip_real_invest
 * @property integer $pip_tahun
 */
class Pelakuinvestasipariwisata extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Pelakuinvestasipariwisata the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'pelakuinvestasipariwisata';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('pip_target_pelaku, pip_real_pelaku, pip_target_tngkerja, pip_real_tngkerja, pip_target_invest, pip_real_invest, pip_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('pip_id, pip_target_pelaku, pip_real_pelaku, pip_target_tngkerja, pip_real_tngkerja, pip_target_invest, pip_real_invest, pip_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'pip_id' => 'Pip',
			'pip_target_pelaku' => 'Pip Target Pelaku',
			'pip_real_pelaku' => 'Pip Real Pelaku',
			'pip_target_tngkerja' => 'Pip Target Tngkerja',
			'pip_real_tngkerja' => 'Pip Real Tngkerja',
			'pip_target_invest' => 'Pip Target Invest',
			'pip_real_invest' => 'Pip Real Invest',
			'pip_tahun' => 'Pip Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('pip_id',$this->pip_id);
		$criteria->compare('pip_target_pelaku',$this->pip_target_pelaku);
		$criteria->compare('pip_real_pelaku',$this->pip_real_pelaku);
		$criteria->compare('pip_target_tngkerja',$this->pip_target_tngkerja);
		$criteria->compare('pip_real_tngkerja',$this->pip_real_tngkerja);
		$criteria->compare('pip_target_invest',$this->pip_target_invest);
		$criteria->compare('pip_real_invest',$this->pip_real_invest);
		$criteria->compare('pip_tahun',$this->pip_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}